package com.learning.security.dal.mysql;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.learning.security.dal.dataobject.AdminUserRoleDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AdminUserRoleMapper extends BaseMapper<AdminUserRoleDO> {
    default List<AdminUserRoleDO> listByUserId(Long userId) {
        LambdaQueryWrapper<AdminUserRoleDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdminUserRoleDO::getUserId, userId);
        return selectList(queryWrapper);
    }
}
